<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<meta name="author" content="SkyKiDS" />
		<meta name="keywords" content="키, 검출, 프로그램, keypress, keydown" />
		<meta name="description" content="누른 키 또는 키값으로 키를 찾아냅니다." />
		<title>키 검출 프로그램</title>
		<style type="text/css">
		<!--
			img {border:0;}
		// -->
		</style>
		<script type="text/javascript">
		<!-- <![CDATA[
			var brKeyPress = 0;
			var brKeyDown = 0;
			function checkKeyPress(event) {
				document.getElementById("resultKeyPressIE").innerHTML += String.fromCharCode(event.keyCode) + " : " + event.keyCode + "&nbsp;&nbsp;&nbsp;";
				document.getElementById("resultKeyPressFF").innerHTML += String.fromCharCode(event.which) + " : " + event.which + "&nbsp;&nbsp;&nbsp;";
				document.getElementById("debugKeyPress").innerHTML += String.fromCharCode(event.charCode) + " : " + event.charCode + "&nbsp;&nbsp;&nbsp;";
				brKeyPress++;
				if((brKeyPress % 5) == 0) {
					document.getElementById("resultKeyPressIE").innerHTML += "<br />";
					document.getElementById("resultKeyPressFF").innerHTML += "<br />";
					document.getElementById("debugKeyPress").innerHTML += "<br />";
				}
			}
			function checkKeyDown(event) {
				document.getElementById("resultKeyDownIE").innerHTML += String.fromCharCode(event.keyCode) + " : " + event.keyCode + "&nbsp;&nbsp;&nbsp;";
				document.getElementById("resultKeyDownFF").innerHTML += String.fromCharCode(event.which) + " : " + event.which + "&nbsp;&nbsp;&nbsp;";
				document.getElementById("debugKeyDown").innerHTML += String.fromCharCode(event.charCode) + " : " + event.charCode + "&nbsp;&nbsp;&nbsp;";
				brKeyDown++;
				if((brKeyDown % 5) == 0) {
					document.getElementById("resultKeyDownIE").innerHTML += "<br />";
					document.getElementById("resultKeyDownFF").innerHTML += "<br />";
					document.getElementById("debugKeyDown").innerHTML += "<br />";
				}
			}

			function clearAll() {
				document.getElementById("resultKeyPressIE").innerHTML = "";
				document.getElementById("resultKeyPressFF").innerHTML = "";
				document.getElementById("debugKeyPress").innerHTML = "";

				document.getElementById("resultKeyDownIE").innerHTML = "";
				document.getElementById("resultKeyDownFF").innerHTML = "";
				document.getElementById("debugKeyDown").innerHTML = "";
			}
//			document.onkeypress = checkKeyPress();
//			document.onkeydown = checkKeyDown();

//			document.addEventListener("keypress", checkKeyPress, true);
//			document.addEventListener("keydown", checkKeyDown, true);
		// ]]> -->
		</script>
	</head>
	<body onkeypress="checkKeyPress(event);" onkeydown="checkKeyDown(event);">
<div>
	<input type="button" value="Reset!" onclick="clearAll();" />
</div>
<div id="resultIE" style="width:100%;">
	W3C Recommendation + Microsoft Internet Explorer
	<table style="width:100%; border:1px solid black; text-align:center; vertical-align:top;">
		<tr><th style="width:50%;">KeyPress event.keyCode</th><th style="width:10px;"></th><th style="width:50%;">KeyDown event.keyCode</th></tr>
		<tr><td id="resultKeyPressIE"></td><td></td><td id="resultKeyDownIE"></td></tr>
	</table>
</div>
<div id="resultFF" style="width:100%;">
	Mozilla Firefox
	<table style="width:100%; border:1px solid black; text-align:center;">
		<tr><th style="width:50%;">KeyPress event.which</th><th style="width:10px;"></th><th style="width:50%;">KeyDown event.which</th></tr>
		<tr><td id="resultKeyPressFF"></td><td></td><td id="resultKeyDownFF"></td></tr>
	</table>
</div>
<div id="debug">
	Debug
	<table style="width:100%; border:1px solid black; text-align:center;">
		<tr><th style="width:50%;">KeyPress event.charCode</th><th style="width:10px;"></th><th style="width:50%;">KeyDown event.charCode</th></tr>
		<tr><td id="debugKeyPress"></td><td></td><td id="debugKeyDown"></td></tr>
	</table>
</div>
<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a></p>
	</body>
</html>
